package com.zjitc.pigspring.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zjitc.pigspring.bean.po.Order;
import com.zjitc.pigspring.bean.po.OrderVO;
import com.zjitc.pigspring.mapper.OrderMapper;
import com.zjitc.pigspring.service.OrderService;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<OrderVO> getByUser(Integer id) {
        return orderMapper.getByUser(id);
    }

    @Override
    public boolean deleteByAddressId(Integer id) {
        return orderMapper.deleteByAddressId(id);
    }

    @Override
    public List<OrderVO> getAll() {
        return orderMapper.getAll();
    }

    @Override
    public List<OrderVO> getAllByGoodName(OrderVO orderVO) {
        return orderMapper.getAllByGoodName(orderVO.getGoodName());
    }

    @Override
    public boolean deleteByGoodId(Integer id) {
        return orderMapper.deleteByGoodId(id);
    }

    @Override
    public boolean deleteByUserId(Integer id) {
        return orderMapper.deleteByUserId(id);
    }

    @Override
    public List<OrderVO> getBySeller(Integer id) {
        return orderMapper.selectBySeller(id);
    }

    @Override
    public List<OrderVO> queryBySeller(OrderVO orderVO) {
        return orderMapper.queryBySeller(orderVO);
    }

}
